package com.huizu.project.controller;

import java.util.List;
import javax.servlet.http.HttpServletResponse;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.PutMapping;
import org.springframework.web.bind.annotation.DeleteMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import com.huizu.common.annotation.Log;
import com.huizu.common.core.controller.BaseController;
import com.huizu.common.core.domain.AjaxResult;
import com.huizu.common.enums.BusinessType;
import com.huizu.project.domain.ProConfigSybz;
import com.huizu.project.service.IProConfigSybzService;
import com.huizu.common.utils.poi.ExcelUtil;
import com.huizu.common.core.page.TableDataInfo;

/**
 * 使用帮助Controller
 * 
 * @author zhangmx
 * @date 2024-06-05
 */
@RestController
@RequestMapping("/project/proconfigsybz")
public class ProConfigSybzController extends BaseController
{
    @Autowired
    private IProConfigSybzService proConfigSybzService;

    /**
     * 查询使用帮助列表
     */
    @PreAuthorize("@ss.hasPermi('project:proconfigsybz:list')")
    @GetMapping("/list")
    public TableDataInfo list(ProConfigSybz proConfigSybz)
    {
        startPage();
        List<ProConfigSybz> list = proConfigSybzService.selectProConfigSybzList(proConfigSybz);
        return getDataTable(list);
    }

    /**
     * 导出使用帮助列表
     */
    @PreAuthorize("@ss.hasPermi('project:proconfigsybz:export')")
    @Log(title = "使用帮助", businessType = BusinessType.EXPORT)
    @PostMapping("/export")
    public void export(HttpServletResponse response, ProConfigSybz proConfigSybz)
    {
        List<ProConfigSybz> list = proConfigSybzService.selectProConfigSybzList(proConfigSybz);
        ExcelUtil<ProConfigSybz> util = new ExcelUtil<ProConfigSybz>(ProConfigSybz.class);
        util.exportExcel(response, list, "使用帮助数据");
    }

    /**
     * 获取使用帮助详细信息
     */
    @PreAuthorize("@ss.hasPermi('project:proconfigsybz:query')")
    @GetMapping(value = "/{id}")
    public AjaxResult getInfo(@PathVariable("id") String id)
    {
        return success(proConfigSybzService.selectProConfigSybzById(id));
    }

    /**
     * 新增使用帮助
     */
    @PreAuthorize("@ss.hasPermi('project:proconfigsybz:add')")
    @Log(title = "使用帮助", businessType = BusinessType.INSERT)
    @PostMapping
    public AjaxResult add(@RequestBody ProConfigSybz proConfigSybz)
    {
        return toAjax(proConfigSybzService.insertProConfigSybz(proConfigSybz));
    }

    /**
     * 修改使用帮助
     */
    @PreAuthorize("@ss.hasPermi('project:proconfigsybz:edit')")
    @Log(title = "使用帮助", businessType = BusinessType.UPDATE)
    @PutMapping
    public AjaxResult edit(@RequestBody ProConfigSybz proConfigSybz)
    {
        return toAjax(proConfigSybzService.updateProConfigSybz(proConfigSybz));
    }

    /**
     * 删除使用帮助
     */
    @PreAuthorize("@ss.hasPermi('project:proconfigsybz:remove')")
    @Log(title = "使用帮助", businessType = BusinessType.DELETE)
	@DeleteMapping("/{ids}")
    public AjaxResult remove(@PathVariable String[] ids)
    {
        return toAjax(proConfigSybzService.deleteProConfigSybzByIds(ids));
    }
}
